import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/// 列表项
class ListItemTeach extends StatelessWidget {
  // 文字
  final String url;

  //点击事件
  final GestureTapCallback onTap;

  // 构造函数
  const ListItemTeach({Key key, this.url, this.onTap}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Size size = MediaQuery.of(context).size;
    var width = size.width * 0.8;
    var width1 = size.width * 0.2;
    return InkWell(
        onTap: onTap,
        child: Padding(
          padding: EdgeInsets.only(top:2),
          child: Row(children: <Widget>[
            Container(
              width: width,
              height: 100,
              color: Colors.white,
              padding: EdgeInsets.only(left: 20),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "金属器皿组合塑造技巧",
                    style: TextStyle(fontSize: 16, color: Colors.black87),
                  ),
                  Text(
                    "本素材是已案例为深度解析，完成示范步骤对照，局部讲解等方式进行训练",
                    style: TextStyle(fontSize: 14, color: Colors.black26),
                  ),
                  Row(children: [
                    Icon(Icons.remove_red_eye),
                    Text(
                      "1856",
                      style: TextStyle(fontSize: 13, color: Colors.black26),
                    ),
                  ],)
                ],
              ),
            ),
            Image.network(
              url,
              height: 100,
              width: width1,
              fit: BoxFit.fill
            )
          ]),
        ));
  }
}

class ActionTeachItem {
  final String url;

  const ActionTeachItem(this.url);
}
